package com.woniuxy.charin.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.charin.common.RedisConst;
import com.woniuxy.charin.model.entity.Contracts;
import com.woniuxy.charin.service.ContractsService;
import com.woniuxy.charin.mapper.ContractsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
* @author Admin
* @description 针对表【contracts】的数据库操作Service实现
* @createDate 2024-12-26 09:46:41
*/
@Service
public class ContractsServiceImpl extends ServiceImpl<ContractsMapper, Contracts>
    implements ContractsService{
    @Autowired
    private ContractsMapper contractsMapper;
    @Override
    @Cacheable(cacheNames = RedisConst.Contracts, keyGenerator = "keyGenerator")

    public Page<Contracts> getAll(int pageNum, int pageSize) {
        Page<Contracts> page = new Page<Contracts>(pageNum,pageSize);
        contractsMapper.selectPage(page,null);
        return page;
    }
}




